package com.chunfeng.mypen.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 日志表
 *
 * @author by 春风能解释
 * <p>
 * 2023/11/15
 */
@Data
@NoArgsConstructor
@ApiModel(value = "日志表", description = "用于存放日志信息")
public class Log implements Serializable {
    /**
     * 序列化常量
     */
    @ApiModelProperty(value = "序列化字段", hidden = true)
    private static final long serialVersionUID = -8029481052127303013L;
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键", allowEmptyValue = true)
    private String id;
    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    private String userId;
    /**
     * 操作(0查询,1新增,2修改,3删除)
     */
    @ApiModelProperty(value = "操作(0查询,1新增,2修改,3删除)", allowableValues = "range[0,3]")
    private Integer option;
    /**
     * 操作对象(取Java实体名)
     */
    @ApiModelProperty(value = "操作对象(实体)")
    private String object;
    /**
     * 结果(0成功,1失败)
     */
    @ApiModelProperty(value = "结果", allowableValues = "0,1")
    private Integer result;
    /**
     * 操作时间
     */
    @ApiModelProperty(value = "操作时间")
    @TableField(fill = FieldFill.INSERT)
    private String optionTime;
    /**
     * 状态(0正常,1失效)
     */
    @ApiModelProperty(value = "状态", allowableValues = "0,1", allowEmptyValue = true)
    @TableLogic
    private Integer status;
}
